namespace MvcEnrollment.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class modifyCourseMig : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Payment",
                c => new
                    {
                        ID = c.Int(nullable: false, identity: true),
                        courseID = c.Int(nullable: false),
                        paymentOption = c.String(),
                        duration = c.Decimal(nullable: false, precision: 18, scale: 2),
                        price = c.Decimal(nullable: false, precision: 18, scale: 2),
                        additionalInfo = c.String(),
                    })
                .PrimaryKey(t => t.ID)
                .ForeignKey("dbo.Course", t => t.courseID, cascadeDelete: true)
                .Index(t => t.courseID);
            
        }
        
        public override void Down()
        {
            DropIndex("dbo.Payment", new[] { "courseID" });
            DropForeignKey("dbo.Payment", "courseID", "dbo.Course");
            DropTable("dbo.Payment");
        }
    }
}
